"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = _default;

var _casCookie = require("@yjtec/cas-cookie");

var _utils = require("../utils/utils");

function _default(data) {
  //写入cookie
  _casCookie.cookie.setCookie(data.ticket); //清楚当前url中的ticket


  setCurrentUrl();
}

function setCurrentUrl() {
  if (history && history.replaceState) {
    if ((0, _utils.getPageQuery)('ticket')) {
      history.replaceState(null, null, (0, _utils.urlExcept)('ticket', window.location.href));
    }
  }
}